<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>strokeandfillelement.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_graphics_strokeandfillelement.js.html">strokeandfillelement.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line2"></a>// you may not use this file except in compliance with the License.
<a name="line3"></a>// You may obtain a copy of the License at
<a name="line4"></a>//
<a name="line5"></a>//     http://www.apache.org/licenses/LICENSE-2.0
<a name="line6"></a>//
<a name="line7"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line8"></a>// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
<a name="line9"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line10"></a>// See the License for the specific language governing permissions and
<a name="line11"></a>// limitations under the License.
<a name="line12"></a>
<a name="line13"></a>// Copyright 2007 Google Inc. All Rights Reserved.
<a name="line14"></a>
<a name="line15"></a>
<a name="line16"></a>/**
<a name="line17"></a> * @fileoverview A thin wrapper around the DOM element for elements with a
<a name="line18"></a> * stroke and fill.
<a name="line19"></a> */
<a name="line20"></a>
<a name="line21"></a>
<a name="line22"></a>goog.provide(&#39;goog.graphics.StrokeAndFillElement&#39;);
<a name="line23"></a>
<a name="line24"></a>goog.require(&#39;goog.graphics.Element&#39;);
<a name="line25"></a>
<a name="line26"></a>
<a name="line27"></a>/**
<a name="line28"></a> * Interface for a graphics element with a stroke and fill.
<a name="line29"></a> * This is the base interface for ellipse, rectangle and other
<a name="line30"></a> * shape interfaces.
<a name="line31"></a> * You should not construct objects from this constructor. The graphics
<a name="line32"></a> * will return an implementation of this interface for you.
<a name="line33"></a> *
<a name="line34"></a> * @param {Element} element The DOM element to wrap.
<a name="line35"></a> * @param {goog.graphics.AbstractGraphics} graphics The graphics creating
<a name="line36"></a> *     this element.
<a name="line37"></a> * @param {goog.graphics.Stroke?} stroke The stroke to use for this element.
<a name="line38"></a> * @param {goog.graphics.Fill?} fill The fill to use for this element.
<a name="line39"></a> * @constructor
<a name="line40"></a> * @extends {goog.graphics.Element}
<a name="line41"></a> */
<a name="line42"></a>goog.graphics.StrokeAndFillElement = function(element, graphics, stroke, fill) {
<a name="line43"></a>  goog.graphics.Element.call(this, element, graphics);
<a name="line44"></a>  this.setStroke(stroke);
<a name="line45"></a>  this.setFill(fill);
<a name="line46"></a>};
<a name="line47"></a>goog.inherits(goog.graphics.StrokeAndFillElement, goog.graphics.Element);
<a name="line48"></a>
<a name="line49"></a>
<a name="line50"></a>/**
<a name="line51"></a> * The latest fill applied to this element.
<a name="line52"></a> * @type {goog.graphics.Fill?}
<a name="line53"></a> * @private
<a name="line54"></a> */
<a name="line55"></a>goog.graphics.StrokeAndFillElement.prototype.fill_ = null;
<a name="line56"></a>
<a name="line57"></a>
<a name="line58"></a>/**
<a name="line59"></a> * The latest stroke applied to this element.
<a name="line60"></a> * @type {goog.graphics.Stroke?}
<a name="line61"></a> * @private
<a name="line62"></a> */
<a name="line63"></a>goog.graphics.StrokeAndFillElement.prototype.stroke_ = null;
<a name="line64"></a>
<a name="line65"></a>
<a name="line66"></a>/**
<a name="line67"></a> * Sets the fill for this element.
<a name="line68"></a> * @param {goog.graphics.Fill?} fill The fill object.
<a name="line69"></a> */
<a name="line70"></a>goog.graphics.StrokeAndFillElement.prototype.setFill = function(fill) {
<a name="line71"></a>  this.fill_ = fill;
<a name="line72"></a>  this.getGraphics().setElementFill(this, fill);
<a name="line73"></a>};
<a name="line74"></a>
<a name="line75"></a>
<a name="line76"></a>/**
<a name="line77"></a> * @return {goog.graphics.Fill?} fill The fill object.
<a name="line78"></a> */
<a name="line79"></a>goog.graphics.StrokeAndFillElement.prototype.getFill = function() {
<a name="line80"></a>  return this.fill_;
<a name="line81"></a>};
<a name="line82"></a>
<a name="line83"></a>
<a name="line84"></a>/**
<a name="line85"></a> * Sets the stroke for this element.
<a name="line86"></a> * @param {goog.graphics.Stroke?} stroke The stroke object.
<a name="line87"></a> */
<a name="line88"></a>goog.graphics.StrokeAndFillElement.prototype.setStroke = function(stroke) {
<a name="line89"></a>  this.stroke_ = stroke;
<a name="line90"></a>  this.getGraphics().setElementStroke(this, stroke);
<a name="line91"></a>};
<a name="line92"></a>
<a name="line93"></a>
<a name="line94"></a>/**
<a name="line95"></a> * @return {goog.graphics.Stroke?} stroke The stroke object.
<a name="line96"></a> */
<a name="line97"></a>goog.graphics.StrokeAndFillElement.prototype.getStroke = function() {
<a name="line98"></a>  return this.stroke_;
<a name="line99"></a>};
<a name="line100"></a>
<a name="line101"></a>
<a name="line102"></a>/**
<a name="line103"></a> * Re-strokes the element to react to coordinate size changes.
<a name="line104"></a> */
<a name="line105"></a>goog.graphics.StrokeAndFillElement.prototype.reapplyStroke = function() {
<a name="line106"></a>  if (this.stroke_) {
<a name="line107"></a>    this.setStroke(this.stroke_);
<a name="line108"></a>  }
<a name="line109"></a>};
</pre>


</body>
</html>
